const NMWiredDeviceItem = GObject.registerClass(
class NMWiredDeviceItem extends NMDeviceItem {
- constructor(client, device) {
- super(client, device);
-
- this.section.addSettingsAction(_('Wired Settings'),
- 'gnome-network-panel.desktop');
- }
-
get icon_name() {
switch (this.state) {
case NM.ActiveConnectionState.ACTIVATING:
constructor(client, device) {
super(client, device);
- const settingsPanel = this._useWwanPanel()
- ? 'gnome-wwan-panel.desktop'
- : 'gnome-network-panel.desktop';
-
- this.section.addSettingsAction(_('Mobile Broadband Settings'), settingsPanel);
-
this._mobileDevice = null;
let capabilities = device.current_capabilities;
return this._mobileDevice?.operator_name || this._deviceName;
}
- _useWwanPanel() {
+ get wwanPanelSupported() {
// Currently, wwan panel doesn't support CDMA_EVDO modems
const supportedCaps =
NM.DeviceModemCapabilities.GSM_UMTS |
}
_autoConnect() {
- if (this._useWwanPanel())
+ if (this.wwanPanelSupported)
launchSettingsPanel('wwan', 'show-device', this._device.udi);
else
launchSettingsPanel('network', 'connect-3g', this._device.get_path());
this._device.bind_property('name',
this, 'name',
GObject.BindingFlags.SYNC_CREATE);
-
- this.section.addSettingsAction(_('Bluetooth Settings'),
- 'gnome-network-panel.desktop');
}
get icon_name() {
sortFunc: (one, two) => one.network.compare(two.network),
});
- this.section.addSettingsAction(_('Wi-Fi Settings'),
- 'gnome-wifi-panel.desktop');
-
this._client.connectObject(
'notify::wireless-enabled', () => this.notify('icon-name'),
'notify::connectivity', () => this.notify('icon-name'),
class NMWirelessSection extends NMDeviceSection {
constructor() {
super(NM.DeviceType.WIFI);
+
+ this.addSettingsAction(_('All Networks'),
+ 'gnome-wifi-panel.desktop');
}
_createDeviceMenuItem(device) {
class NMWiredSection extends NMDeviceSection {
constructor() {
super(NM.DeviceType.ETHERNET);
+
+ this.addSettingsAction(_('Wired Settings'),
+ 'gnome-network-panel.desktop');
}
_createDeviceMenuItem(device) {
class NMBluetoothSection extends NMDeviceSection {
constructor() {
super(NM.DeviceType.BT);
+
+ this.addSettingsAction(_('Bluetooth Settings'),
+ 'gnome-network-panel.desktop');
}
_createDeviceMenuItem(device) {
class NMModemSection extends NMDeviceSection {
constructor() {
super(NM.DeviceType.MODEM);
+
+ const settingsLabel = _('Mobile Broadband Settings');
+ this._wwanSettings = this.addSettingsAction(settingsLabel,
+ 'gnome-wwan-panel.desktop');
+ this._legacySettings = this.addSettingsAction(settingsLabel,
+ 'gnome-network-panel.desktop');
}
_createDeviceMenuItem(device) {
'%s Modem Connections',
nDevices).format(nDevices);
}
+
+ _sync() {
+ super._sync();
+
+ const useWwanPanel =
+ [...this._items.values()].some(i => i.wwanPanelSupported);
+ this._wwanSettings.visible = useWwanPanel;
+ this._legacySettings.visible = !useWwanPanel;
+ }
}
var NMApplet = GObject.registerClass(